import itertools

data_list = [
    "fnd17_oxlcxspebq", "fnd17_shsoutbs", "fnd28_value_05191q", "fnd28_value_05192q",
    "fnd28_value_05301q", "fnd28_value_05302", "fnd17_pehigh", "fnd17_pelow",
    "fnd17_priceavg150day", "fnd17_priceavg200day", "fnd17_priceavg50day", "fnd17_pxedra",
    "fnd17_tbea", "fnd28_newa3_value_18191a", "fnd28_newa3_value_18198a", "fnd28_value_02300a"
]

combinations = list(itertools.combinations(data_list, 2))
print(combinations)

alpha_expressions = []
formatter = "ts_regression(ts_zscore({}, 500), ts_zscore({}, 500), 500)"
for item in combinations:
    A, B = item
    alpha_single = formatter.format(A,B)
    alpha_expressions.append(alpha_single)

print('total combinations: ', len(alpha_expressions))
print("\nfollowings are all meet require's consequences：")
for item in alpha_expressions:
    print(item)
